/*
 * @Author: HaiF
 * @Date: 2020-12-02 11:43:08
 * @LastEditTime: 2020-12-03 00:25:12
 * @LastEditors: your name
 * @Description: 用户管理
 * @FilePath: \adminPC\src\store\modules\menber.js
 * @可以输入预定的版权声明、个性签名、空行等
 */

import { list } from '@/api/menber'

const state = {
  currentUser: null,
  userList: []
}

const mutations = {
  SET_LIST(state, list = []) {
    state.userList = list
  }
}

const actions = {
  getUSerList({ commit }, params) {
    list(params).then(res => {
      const { code, data: { list }} = res
      if (code === 200) {
        commit('SET_LIST', list)
      }
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
